﻿/*
 * imaeg - generic image utility in C#
 * Copyright (C) 2010  ed <tripflag@gmail.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License v2
 * (version 2) as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, refer to the following URL:
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace imaeg {
    static class Program {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        public static string[] args;
        static bool debug = false;
        [STAThread]
        static void Main(string[] argv) {
            args = argv;
            if (debug) { // AW FUCK, I CANT BELIEVE IVE DONE THIS
                dbgstream = new System.IO.FileStream(Application.StartupPath + "\\imaeg-debug.txt", System.IO.FileMode.Append);
                dbg("\r\n\r\n\r\n" +
                    System.DateTime.Now.ToLongDateString() + " - " +
                    System.DateTime.Now.ToLongTimeString());
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
        static System.IO.FileStream dbgstream;
        public static void dbg(string str) {
            if (debug) {
                byte[] b = System.Text.Encoding.UTF8.GetBytes(" -!- " + str + "\r\n");
                dbgstream.Write(b, 0, b.Length);
                dbgstream.Flush();
            }
        }
    }
}
